package com.neusoft.controller;

import com.neusoft.po.Food;
import com.neusoft.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RefreshScope       //开启动态刷新
@RequestMapping("/FoodController")
public class FoodController {
	
	@Autowired
	private FoodService foodService;

	@RequestMapping("/listFoodByBusinessId/{businessId}")
	public List<Food> listFoodByBusinessId(@PathVariable("businessId") Integer businessId) throws Exception{
		return foodService.listFoodByBusinessId(businessId);
	}
}
